<?php
/**
+-----------------------------------------------------------------------------------------------
* GouGuOPEN [ 左手研发，右手开源，未来可期！]
+-----------------------------------------------------------------------------------------------
* @Copyright (c) 2021~2024 http://www.gouguoa.com All rights reserved.
+-----------------------------------------------------------------------------------------------
* @Licensed 勾股OA，开源且可免费使用，但并不是自由软件，未经授权许可不能去除勾股OA的相关版权信息
+-----------------------------------------------------------------------------------------------
* @Author 勾股工作室 <hdm58@qq.com>
+-----------------------------------------------------------------------------------------------
*/
namespace app\lawcase\validate;

use think\Validate;

class NodeTypeCheck extends Validate
{
    protected $rule = [
        'name' => 'require|max:50',
        'description' => 'max:255',
        'case_type' => 'require',
        'sort' => 'number|between:0,9999',
        'id' => 'require|number|gt:0',
    ];
    
    protected $message = [
        'name.require' => '节点类型名称不能为空',
        'name.max' => '节点类型名称最多不能超过50个字符',
        'description.max' => '描述最多不能超过255个字符',
        'case_type.require' => '案件类型不能为空',
        'sort.number' => '排序值必须是数字',
        'sort.between' => '排序值必须在0-9999之间',
        'id.require' => 'ID不能为空',
        'id.number' => 'ID必须是数字',
        'id.gt' => 'ID必须大于0',
    ];
    
    protected $scene = [
        'add' => ['name', 'case_type', 'sort'],
        'edit' => ['id', 'name', 'case_type', 'sort'],
    ];
}